export default function getRequestErrorMessage(
  error: any,
  initial = "请求错误!",
) {
  if (!error) {
    return initial;
  }
  if (typeof error === "string") {
    return error;
  }
  if ("msg" in error) {
    return error.msg;
  }
  if ("message" in error) {
    return error.message;
  }
  return initial;
}
